package com.company.aop;

import com.company.Website;

/**
 * 静态代理
 */

public class StaticProxy implements Website {

    public Website getWebsite() {
        return website;
    }

    public void setWebsite(Website website) {
        this.website = website;
    }

    public StaticProxy(Website website) {
        this.website = website;
    }

    private Website website;

    @Override
    public void request() {
        System.out.println("代理类对request()的前置处理");
        website.request();
        System.out.println("代理类对request()的后置处理");
    }

    @Override
    public void response() {
        System.out.println("代理类对response()的前置处理");
        website.response();
        System.out.println("代理类对response()的后置处理");
    }
}
